package com.example.user

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.CategoryEntityItem
import com.example.user.databinding.ItemCategoryBinding

class CategoryAdapter:BaseQuickAdapter<CategoryEntityItem,BaseViewHolder>(R.layout.item_category) {
    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        super.onItemViewHolderCreated(viewHolder, viewType)
        DataBindingUtil.bind<ItemCategoryBinding>(viewHolder.itemView)
    }

    override fun convert(helper: BaseViewHolder, item: CategoryEntityItem) {
        val binding = DataBindingUtil.getBinding<ItemCategoryBinding>(helper.itemView)
        binding?.info = item
    }
}